<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="description" content="struts2 and tiles sample page with html5" />
	<title>frame</title>
	<script type="text/javascript" src="/edu/js/jquery-1.6.4.js"></script>
	<script type="text/javascript" src="/edu/js/common.js"></script>
	<script type="text/javascript">
	<!--//
	function chkValue() {
		
		if($("#image_url_file").val() == 0) {
			alert("select your profile photo.");
			return false;
		}
		
		return true;
	}
	
	$(window).load(function(){
		if($("#imgFullPath").html() != "/edu/images/uploadFolder/"){
			$("#image_url",parent.document).val($("#imgFullPath").html());
		}
	});
	//-->
	</script>
</head>
<body style="margin:0; text-align:center overflow:hidden">
	<span id="imgFullPath" style="display:none;">/edu/images/uploadFolder/<s:iterator value="dto"><s:property value="fileName"/></s:iterator></span>
	<form id="uploadfrm" name="uploadfrm" method="post" target="_self" enctype="multipart/form-data" action="/edu/uploadProfileImage.action" onsubmit="return chkValue();" >
		<div style="margin:0; text-align:center; width:100%; overflow:hidden; position:absolute; top:30px; left:0px;">
			<img src="/edu/images/uploadFolder/<s:iterator value="dto"><s:property value="fileName"/></s:iterator>" onError="this.src='/edu/images/noPhoto.jpg'" style="width:125px; height:100px; "><br>
		</div>
		<div style="margin:0; text-align:center; width:100%; overflow:hidden; position:absolute; top:150px;">
			<input type="file" id="image_url_file" name="image_url_file" style="width:180px;" /><br>
			<input type="submit" value="Upload" />
		</div>
	</form>
</body>
</html>
 